﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cecbData;

namespace Dss.Methods
{
    public class Email
    {
        public Email()
        {
            dataContext = new DSSEntities();
        }
        DSSEntities  dataContext;

       


        public String getTeamRefByProRef(String pro_reference)
        {
            //var Ref = (from c in dataContext.Projects
            //           where c.proj_reference == pro_reference
            //           select c).First();

            //String memRef = Ref.proj_team.ToString();

            //return memRef;
            return "";
        }

        //public List<Members> getTeamMembers(String pro_reference)
        //{
        //    List<Members> teamMembers = new List<Members>();
           

        //    var quary = from c in dataContext.Projects
        //             join b in dataContext.Team_Members on c.proj_team equals b.team_reference
        //             select new
        //             {
        //                 b.mem_reference
        //             };

        //    return quary.ToList<Members>;
        //}

        
        public string genarateRandomUsername(int Size)
        {
            Random ran = new Random();
            string input = "abcdefghijklmnopqrstuvwxyz";
            StringBuilder builder = new StringBuilder();
            char ch;
            for (int i = 0; i < Size; i++)
            {
                ch = input[ran.Next(0, input.Length)];
                builder.Append(ch);
            }
            return builder.ToString();
        }

        public string genarateRandomPassword(int Size)
        {
            Random ran = new Random();
            string input = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
            StringBuilder builder = new StringBuilder();
            char ch;
            for (int i = 0; i < Size; i++)
            {
                ch = input[ran.Next(0, input.Length)];
                builder.Append(ch);
            }
            return builder.ToString();
        }
    }
}
